<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>CS 234: Programming in Visual Basic</title></head><body>

<center><h4>
            CS334 - Prog4: Database Application
            <br>
            (20 Points)
</h4></center>
      Create a VB program to access a database file. The program has two forms: frmAll and frmIndividual,
      and it could have one code module.
      
<h4>The Database Table</h4>
The database file is Activity.mdb. 
The database has several tables, but the project will access only one table 
Employee. The table schema for Employyee is as follows:
      <pre>    UserName    : Varchar(8), required
    FirstName   : Varchar(20), required
    LastName    : Varchar(20), required
    Department  : Integer(short), required
    DeptPosition: Varchar(15)
    Email       : Varchar(50)
    Phone       : Varchar(4)
    
    Field UserName is the primary key.
</pre>

<h4> Loading Database Table </h4>
<ol>
<li> You can setup connection and adapter at design time. </li>
<li> Your program must store the location and the name of the database file. </li>
<li> If the file location or file name changes, your program must use
an Open File Dialog for the user to select the new database file. </li>
<li> If the selected database file does not work, your program must display the Open File Dialog again. </li>
<li> If the user does not select a database file, your program should display a message box and terminate. </li>
<li> If the selected database file works for the program, the new file name/location must be stored for future use. </li>
<li> <b>(Bonus: two points)</b> Use a text file to store the database file location and name. 
     The text file must have a name of prog4.ini and located in folder bin of the solution.
     The file is used to store all initialization data for the program.
     Although you only need the database file location/name, the file must have several lines of texts and
     one line contains the database file location/name. The number of lines and the order of the lines could be changed.
</li>
</ol>

<h4>Form frmAll</h4>
      <ol>
         <li>
         The form title is "Prog4" followed by your name and it has no control box. 
         The form has a DataGridView and three buttons. 
         Your form including the DataGridView <b>must</b> be very similar to that of the sample program.</li>
         <li>
         The DataGridView displays all records from table Employee. All columns except column Email are displayed.
         The DataGridView is read only. </li>
         <li>
         The three buttons must do the work suggested by their texts. </li>
      </ol>

<h4>Form frmIndividual </h4>
      <ol>
         <li>
         The form title is "Prog4" followed by your name and it has no control box. 
         Your form <b>must</b> be very similar to that of the sample program.</li>
         <li>
         The form has one textbox for each column of table Employee with a label to the left, and
         one record of the table is displayed at a time.
         </li>
         <li> 
         The form has a BindingNavigator with three additional buttons: RELOAD, ALL EMPLOYEES, and EXIT.
         Each button, including the three additional buttons, will do the work suggested by the text/image. </li>
         <li> When a user modifies the Department field of an existing record or enters the department field for a new record,
              an error provider will display an flashing icon to the right of the textbox if a non-digit charactor is entered.
         </li>
      </ol>

<h4>Submission </h4>
<ol>
<li> You must do the program in pairs, and you must have a different partner from previous programs. </li>
<li> You must sign a pairing sheet by 11 AM, Thursday, March 22. 
     <b>Otherwise, you will lose two points.</b> </li>
<li> Use your UserName to name the solution folder. </li>
<li> Drop your solution folder to folder Prog4 of the class DROP folder by 11 PM, Tuesday, March 27, 2007. </li>
<li> You must send an email to the instructor by 11 PM, Tuesday, March 27, 2007.
     <br> 
     Answer the following three questions in the email (1 is the lowest score and 5 is the highest score):
     <ol>
     <li> What do you think of your partner's programming skill? (1 to 5) </li>
     <li> What do you think of your partner's contribution to the program? (1 to 5) </li>
     <li> Do you want to work with your partner in the future? (1 to 5) </li>
     </ol>
     </li>
<li> You may lose up to two points for incorrect submission, including missing email and incorrect folder name. </li>
<li> You must follow the programming rules, and you may lose up to 2 points on style. </li>
</ol>

</body></html>